home *** CD-ROM | disk | FTP | other *** search
/ Internet Tools (InfoMagic) / Internet Tools.iso / dos_win / winsock / hacklist / 94-04.Z / 94-04 / 000002_alun@internet.wst.com_Thu Apr 3 03:00:12 1994.msg < prev    next >
Internet Message Format  |  1994-04-30  |  6KB

  1. Received: from internet.wst.com.wst.com ([198.64.82.8]) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  2.           id AA14695; Thu, 31 Mar 1994 09:58:27 -0500
  3. Received: by internet.wst.com.wst.com (4.1/SMI-4.1)
  4.     id AA00773; Thu, 31 Mar 94 09:00:13 CST
  5. From: alun@internet.wst.com (Alun Jones)
  6. Message-Id: <9403311500.AA00773@internet.wst.com.wst.com>
  7. Subject: Re: Closing and reusing sockets
  8. To: paul@atlas.abccomp.oz.au
  9. Date: Thu, 31 Mar 94 9:00:12 CST
  10. Cc: winsock-hackers@sunsite.unc.edu
  11. In-Reply-To: <9403310353.AA25427@atlas>; from "paul@atlas.abccomp.oz.au" at Mar 31, 94 9:11 am
  12. X-Mailer: ELM [version 2.3 PL11]
  13.  
  14. After much talk on issues of bind() and connect() and listen() and
  15. sockets whose address is already in use, Paul Brooks added:
  16.  
  17. > To avoid WSAEADDRINUSE errors, you must make sure a socket is fully closed
  18. > before you can connect _from_the_same_port_number_ to the same remote
  19. > machine listening on the _same_remote_port_ - possibly by blocking in 
  20. > a lingering close, or using linger to hard-close the connection when
  21. > you're done the first time.
  22.  
  23. Please note that if you're writing a server, you are most likely
  24. listening for any machine, which is a special remote machine address,
  25. and quite obviously you will not be able to listen for any machine on
  26. that same port until the previous server's job has totally finished.
  27.  
  28. Alun.
  29. ~~~~
  30. From alun@internet.wst.com Thu Apr  3 03:07:28 1994
  31. Received: from internet.wst.com.wst.com ([198.64.82.8]) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  32.           id AA15965; Thu, 31 Mar 1994 10:04:18 -0500
  33. Received: by internet.wst.com.wst.com (4.1/SMI-4.1)
  34.     id AA00810; Thu, 31 Mar 94 09:07:29 CST
  35. From: alun@internet.wst.com (Alun Jones)
  36. Message-Id: <9403311507.AA00810@internet.wst.com.wst.com>
  37. Subject: Winsock on top of DOS stacks.
  38. To: winsock-hackers@sunsite.unc.edu
  39. Date: Thu, 31 Mar 94 9:07:28 CST
  40. X-Mailer: ELM [version 2.3 PL11]
  41.  
  42. Here's an interesting problem - I have my WSACleanup code called in
  43. the OnDestroy part of my CWinApp (you can tell which compiler I'm
  44. using, right?), and it doesn't seem to get called in the situation of
  45. the Windows system being closed.  Now this is obviously a bug in my
  46. program, but it causes an interesting problem that might bear
  47. investigating.
  48.  
  49. If Windows exits unexpectedly, and yet the DOS subsystem is still
  50. running, and if the underlying TCP/IP stack is a DOS-based system (and
  51. still running), should all connected/listening sockets be closed?
  52. Under at least one implementation, for instance, when going back into
  53. windows, my ftp daemon won't start, because (it claims) the ftp port
  54. is being listened on by some other process (presumably my previous
  55. instance under windows).
  56.  
  57. If Windows exits cleanly, but applications haven't called WSACleanup,
  58. or closed all their sockets, should the TCP/IP stack underneath be
  59. responsible for noting that there is no process connected with those
  60. sockets, and close them itself?
  61.  
  62. I'm not (yet) arguing one way or the other - just soliciting comments
  63. as to how this might be achieved - whether it's reasonably easy or
  64. not, and whether it's something that might be put into the standard.
  65.  
  66. And on an unrelated note, I seem to remember somebody mentioning a
  67. Winsock-a-thon session coming up soon at Microsoft - is anyone going
  68. to be testing some of the shareware programs there, too? (esp. mine!
  69. :)
  70.  
  71. Alun.
  72. ~~~~
  73. From rcq@mailserv-D.ftp.com Fri Apr  1 19:39:35 1994
  74. Received: from ftp.com by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  75.           id AA26905; Sat, 2 Apr 1994 01:03:30 -0500
  76. Received: from mailserv-D.ftp.com by ftp.com  ; Sat, 2 Apr 1994 00:40:26 -0500
  77. Received: from rcq.hurricane.ftp.com by mailserv-D.ftp.com (5.0/SMI-SVR4)
  78.     id AA02833; Sat, 2 Apr 94 00:39:35 EST
  79. Date: Sat, 2 Apr 94 00:39:35 EST
  80. Message-Id: <9404020539.AA02833@mailserv-D.ftp.com>
  81. To: alun@internet.wst.com
  82. Subject: Re: Winsock on top of DOS stacks.
  83. From: rcq@ftp.com  (Bob Quinn)
  84. Reply-To: rcq@ftp.com
  85. Cc: Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
  86. Sender: rcq@mailserv-D.ftp.com
  87. Repository: mailserv-D.ftp.com, [message accepted at Sat Apr  2 00:39:24 1994]
  88. Originating-Client: hurricane.ftp.com
  89. Content-Length: 1826
  90.  
  91. >  If Windows exits cleanly, but applications haven't called WSACleanup,
  92. >  or closed all their sockets, should the TCP/IP stack underneath be
  93. >  responsible for noting that there is no process connected with those
  94. >  sockets, and close them itself?
  95.  
  96. A better way to phrase the question is in terms of tasks, I think.
  97. You could ask: "should sockets persist after their tasks are ended?"
  98. To this, I'd answer no.  Orphaned sockets should be closed by the
  99. stack/DLL.
  100.  
  101. I know that our current WinSock DLL can leave orphan sockets under
  102. some circumstances after an application has ended.  I've seen this
  103. happen with our DLL if the application GPF's (so Windows doesn't call
  104. the Windows Exit Procedure: WEP() to unload our DLL), or if an
  105. application doesn't call WSACleanup() *AND* there's another WinSock
  106. application execution (so the DLL stays memory resident).  Doing the
  107. "garbage collection" to reclaim orphaned sockets after these
  108. scenarios is definately something high on the list of things that we
  109. plan to address.
  110.   
  111. >  And on an unrelated note, I seem to remember somebody mentioning a
  112. >  Winsock-a-thon session coming up soon at Microsoft - is anyone going
  113. >  to be testing some of the shareware programs there, too? (esp. mine!
  114.  
  115. Considering that there're only two days to test what will likely be a
  116. large matrix of applications and WinSock implementations, it is not
  117. likely anyone will be testing anything that doesn't have a body
  118. representing it.  
  119.  
  120. But on the bright side, you can be sure I'll bring your FTP Daemon
  121. and the plethora of other public domain applications along for the
  122. ride.  Proven applications like these are always handy for
  123. benchmarks, if nothing else!
  124.  
  125. Regards,
  126. --
  127.  Bob Quinn                                             rcq@ftp.com
  128.  FTP Software, Inc.                                No. Andover, MA